package com.io.exception;

import java.io.EOFException;

/**
 * The class/interface
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public class ScExceptionUtils {
    /**
     * NullPointException 空指针异常 快速返回类
     *
     * @param message
     * @return
     */
    public static ScException np(String message) {
        return new ScException(506, message, new NullPointerException(message));
    }

    /**
     * end of stream Exception 空指针异常 快速返回类
     *
     * @param message
     * @return
     */
    public static ScException eof(String message) {
        return new ScException(507, message, new EOFException(message));
    }

    /**
     * 错误的参数异常
     *
     * @param message
     * @return
     * @author makai@comleader.com.cn
     * @since 0.0.1
     */
    public static ScException args(String message) {
        return new ScException(400, message, new IllegalArgumentException(message));
    }
}
